//求和相关的配置
const countOptions = {
	namespaced: true,
	actions: {
		odd(context, value) {
			console.log(context)
			if (context.state.sum % 2) {
				context.commit('ODD', value)
			}
		},
		wait(context, value) {
			setTimeout(function() {
				context.commit('WAIT', value)
			}, 1000);
		}
	},
	mutations: {
		JIA(state, value) {
			state.sum += value
		},
		JIAN(state, value) {
			state.sum -= value
		},
		ODD(state, value) {
			state.sum += value
		},
		WAIT(state, value) {
			state.sum += value
		},
	},
	state: {
		sum: 0,
		school: '老八技校',
		subject: '奥里给',
	},
	getters: {
		bigSum(state) {
			return state.sum * 10
		}
	}
}
export default countOptions